﻿<%@ WebHandler Language="C#" Class="_1Handler" %>

using System;
using System.Web;

public class _1Handler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";
        string username = context.Request["txtUsername"];
        context.Response.Write(username+"<font color='red'>你好</font>"+Guid.NewGuid());
        context.Response.Write(@"<form action='1Handler.ashx' method='post'>
用户名：<input type='text' name='txtUsername' /><input type='submit' value='提交' />
</form>");

        string ispostback = context.Request["ispostback"];
        if (ispostback == "true")
        {
            context.Response.Write("提交进入");
        }
        else
        {
            context.Response.Write("直接进入");
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}